﻿using System;
using System.Data;
using System.Collections;
using CE.Database;


/// <summary>
/// Summary description for GeneralReportsDB
/// </summary>
namespace CE.Report
{
    public class GeneralReportsDB
    {
        public GeneralReportsDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public DataTable GetCallMeSummary(Int64 ProviderId, Int16 CallMeTime, Int16 ReportType, string ReportDate1, string ReportDate2)
        {
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocCallMeSummaryReportSelectedList]";
            SortedList _sPara = new SortedList();

            _sPara.Add("@ProviderCompanyId", ProviderId);
            _sPara.Add("@CallTime", CallMeTime);
            _sPara.Add("@ReportType", ReportType);
            _sPara.Add("@ReportDate1", ReportDate1);
            _sPara.Add("@ReportDate2", ReportDate2);

            return _db.GetDataTableBySP(_spName, _sPara);
        }

        public DataTable GetCallMeSummary(Int64 ProviderId, Int16 CallMeTime, Int16 ReportType, string ReportDate1, string ReportDate2, Int64 CEID)
        {
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocCallMeSummaryReportSelectedList]";
            SortedList _sPara = new SortedList();

            _sPara.Add("@ProviderCompanyId", ProviderId);
            _sPara.Add("@CallTime", CallMeTime);
            _sPara.Add("@ReportType", ReportType);
            _sPara.Add("@ReportDate1", ReportDate1);
            _sPara.Add("@ReportDate2", ReportDate2);
            _sPara.Add("@CEID", CEID);

            return _db.GetDataTableBySP(_spName, _sPara);
        }

        public DataTable GetSetReminderSummary(Int16 Month, Int16 ReportType, string ReportDate1, string ReportDate2)
        {
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocSetReminderSummaryReportSelectedList]";
            SortedList _sPara = new SortedList();

            _sPara.Add("@Month", Month);
            _sPara.Add("@ReportType", ReportType);
            _sPara.Add("@ReportDate1", ReportDate1);
            _sPara.Add("@ReportDate2", ReportDate2);

            return _db.GetDataTableBySP(_spName, _sPara);
        }

        public DataTable GetMostSelectedCarModelSummary(Int32 Count, Int16 ReportType, string ReportDate1, string ReportDate2)
        {
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocMostSelectedCarModelSummaryReport]";
            SortedList _sPara = new SortedList();

            _sPara.Add("@Count", Count);
            _sPara.Add("@ReportType", ReportType);
            _sPara.Add("@ReportDate1", ReportDate1);
            _sPara.Add("@ReportDate2", ReportDate2);

            return _db.GetDataTableBySP(_spName, _sPara);
        }

        public DataTable GetMostSelectedCurrentInsurerSummary(Int32 Count, string Language, Int16 ReportType, string ReportDate1, string ReportDate2)
        {
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocMostSelectedCurrentInsurerSummaryReport]";
            SortedList _sPara = new SortedList();

            _sPara.Add("@Count", Count);
            _sPara.Add("@Language", Language);
            _sPara.Add("@ReportType", ReportType);
            _sPara.Add("@ReportDate1", ReportDate1);
            _sPara.Add("@ReportDate2", ReportDate2);

            return _db.GetDataTableBySP(_spName, _sPara);
        }

        public DataTable GetQuotesCountByUserAge(Int16 ReportType, string ReportDate1, string ReportDate2)
        {
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocCIQuoteSummaryReportByUserAge]";
            SortedList _sPara = new SortedList();

            _sPara.Add("@ReportType", ReportType);
            _sPara.Add("@ReportDate1", ReportDate1);
            _sPara.Add("@ReportDate2", ReportDate2);

            return _db.GetDataTableBySP(_spName, _sPara);
        }

        public DataTable GetQuotesCountByUserGender(Int16 ReportType, string ReportDate1, string ReportDate2)
        {
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocCIQuoteSummaryReportByUserGender]";
            SortedList _sPara = new SortedList();

            _sPara.Add("@ReportType", ReportType);
            _sPara.Add("@ReportDate1", ReportDate1);
            _sPara.Add("@ReportDate2", ReportDate2);

            return _db.GetDataTableBySP(_spName, _sPara);
        }

        public DataTable GetQuotesCountByUserOccupation(Int16 ReportType, string Language, string ReportDate1, string ReportDate2)
        {
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocCIQuoteSummaryUserOccupation]";
            SortedList _sPara = new SortedList();

            _sPara.Add("@ReportType", ReportType);
            _sPara.Add("@Language", Language);
            _sPara.Add("@ReportDate1", ReportDate1);
            _sPara.Add("@ReportDate2", ReportDate2);

            return _db.GetDataTableBySP(_spName, _sPara);
        }

        public DataTable GetUserAgeQuotesResultCount(Int16 ReportType, string ReportDate1, string ReportDate2)
        {
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocUserAgeQuotesCountReportSelectedList]";
            SortedList _sPara = new SortedList();

            _sPara.Add("@ReportType", ReportType);
            _sPara.Add("@ReportDate1", ReportDate1);
            _sPara.Add("@ReportDate2", ReportDate2);

            return _db.GetDataTableBySP(_spName, _sPara);
        }

    }
}